//
//  ACEQuestionAnswerHeaderView.m
//  ACE
//
//  Created by zhangtao on 2018/8/13.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEQuestionAnswerHeaderView.h"

@implementation ACEQuestionAnswerHeaderView

{
    UILabel *titleLab;
    UILabel *line;
}

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        titleLab = [[UILabel alloc]initWithFrame:CGRectMake(15, 15, frame.size.width-30, frame.size.height-30)];
        [self addSubview:titleLab];
        titleLab.numberOfLines = 0;
        line = [[UILabel alloc]initWithFrame:CGRectMake(15, frame.size.height, frame.size.width-30, 1)];
        line.backgroundColor = RGB(240, 240, 240, 1);
        [self addSubview:line];
        
    }
    return self;
}

-(void)setHeight:(CGFloat)height{
    _height = height;
    self.frame = CGRectMake(0, 0, self.frame.size.width, height);
    titleLab.frame = CGRectMake(15, 15, self.frame.size.width-30, self.frame.size.height-30);
    line.frame = CGRectMake(15,height-1, self.frame.size.width-30, 1);
}

-(void)setAnswer:(NSString *)answer{
    _answer = answer;
    titleLab.text = _answer;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
